<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui">
    <ui:composition template="/template/DefaultTemplate.xhtml">
  
        <ui:define name="content">
            <h:form>
                <p:panel header="View Backorder">
                    <p:messages />
                    <br />
                    <h:panelGrid columns="6">
                   
                        <h:outputText value="Sales Executive:" />
                        <h:outputText value="#{salesOrderEntityController.selected.systemUser.firstName}&nbsp;#{salesOrderEntityController.selected.systemUser.lastName}" rendered="#{salesOrderEntityController.selected.systemUser!=null}"/>
                        <h:outputText value="*Price Not Quoted*" style="color:red" rendered="#{salesQuotationEntityController.selected.systemUser==null}"/>
                        
                        <h:outputText value="Indicative Lead Time:"/>
                        <h:outputText value="#{salesOrderEntityController.selected.purchaseOrder.salesQuotation.indicativeLeadTime}" title="Indicative Lead Time" rendered="#{salesOrderEntityController.selected.purchaseOrder.salesQuotation.indicativeLeadTime!=null}"/>
                        <h:outputText value="*Date Not Given*" style="color:red" rendered="#{salesOrderEntityController.selected.purchaseOrder.salesQuotation.indicativeLeadTime==null}"/>
                    
                        
                        <h:outputText value="Customer: " rendered="#{salesOrderEntityController.selected.customer!=null}"/>
                        <h:outputText value="#{salesOrderEntityController.selected.customer.firstName}&nbsp;#{salesOrderEntityController.selected.customer.lastName}" rendered="#{salesOrderEntityController.selected.customer!=null}"/>
                        <h:outputText value="Customer Id:" rendered="#{salesOrderEntityController.selected.customer!=null}" />
                        <h:outputText value="#{salesOrderEntityController.selected.customer}" rendered="#{salesQuotationEntityController.selected.customer!=null}"/>
                        
                        <h:outputText value="#{bundle.ViewSalesQuotationEntityLabel_createdBy}"/>
                        <h:outputText value="#{salesQuotationEntityController.selected.createdBy.firstName}&nbsp;#{salesQuotationEntityController.selected.createdBy.lastName}" title="#{bundle.ViewSalesQuotationEntityTitle_createdBy}"/>
                        <h:outputText value="" />
                        <h:outputText value="" />
                        <h:outputText value="#{bundle.ViewSalesQuotationEntityLabel_lastModifiedBy}"/>
                        <h:outputText value="#{salesQuotationEntityController.selected.lastModifiedBy.firstName}&nbsp;#{salesQuotationEntityController.selected.lastModifiedBy.lastName}" title="#{bundle.ViewSalesQuotationEntityTitle_lastModifiedBy}"/>
                        
                        <h:outputText value="#{bundle.ViewSalesQuotationEntityLabel_createdAt}"/>
                        <h:outputText value="#{salesQuotationEntityController.selected.createdAt}" title="#{bundle.ViewSalesQuotationEntityTitle_createdAt}">
                            <f:convertDateTime pattern="dd/MM/yyyy" />
                        </h:outputText>
                        <h:outputText value="" />
                        <h:outputText value="" />
                        <h:outputText value="#{bundle.ViewSalesQuotationEntityLabel_lastModifiedAt}"/>
                        <h:outputText value="#{salesQuotationEntityController.selected.lastModifiedAt}" title="#{bundle.ViewSalesQuotationEntityTitle_lastModifiedAt}">
                            <f:convertDateTime pattern="dd/MM/yyyy" />
                        </h:outputText>
                        
                    </h:panelGrid>

                    <h:form styleClass="jsfcrud_list_form">
                            <h:dataTable value="#{salesQuotationEntityController.selected.pqp}" var="pqp" border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px">
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="Product"/>
                                    </f:facet>
                                    <h:outputText value="#{pqp.product.productName}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="Quantity"/>
                                    </f:facet>
                                    <h:outputText value="#{pqp.quantity}"/>
                                </h:column>
                                <h:column>
                                    <f:facet name="header">
                                        <h:outputText value="Price"/>
                                    </f:facet>
                                    <p:inputText value="#{pqp.price}"/>
                                </h:column>
                            </h:dataTable>
                        
                    </h:form>
                    <br />
                    <p:commandButton action="#{salesQuotationEntityController.update}" actionListener="#{salesQuotationEntityController.setQuote}" value="Save" ajax="false"/>
                    &nbsp;
                    <p:commandButton ajax="false" action="View" value="View"/>
                    &nbsp;
                    <p:commandButton ajax="false" action="#{salesQuotationEntityController.prepareList}" value="Show All"/>
                    <br />
                    <br />
                </p:panel>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
